package 数组的操作;

import java.util.Scanner;
//　输入一个3行4列的数组，找出该数组中绝对值最大的元素、输出该元素及其两个下标值。如有多个输出行号最小的，还有多个的话输出列号最小的。
//        样例输入
//        1 2 3 5
//        -2 5 8 9
//        6 -7 5 3
//        样例输出
//        9 2 4
public class 数组输出 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int[] a = new int[4];
        int[] b = new int[4];
        int[] c = new int[4];
        int maxa = a[0];
        int al = 0;
        int maxb = b[0];
        int bl = 0;
        int maxc = c[0];
        int cl = 0;
        // 输入a
        for (int i = 0; i < a.length; i++) {
            a[i] = Math.abs(scanner.nextInt());
        }
        for (int i = 0; i < b.length; i++) {
            b[i] = Math.abs(scanner.nextInt());
        }
        for (int i = 0; i < c.length; i++) {
            c[i] = Math.abs(scanner.nextInt());
        }
        // 获得最大值
        for (int i = 0; i < a.length; i++) {
            maxa = Math.max(maxa, a[i]);
            maxb = Math.max(maxb, b[i]);
            maxc = Math.max(maxc, c[i]);
        }

        for (int i = 0; i < a.length; i++) {
            if (a[i] == maxa) {
                al = i;
                break;
            }
        }
        for (int i = 0; i < a.length; i++) {
            if (b[i] == maxb) {
                bl = i;
                break;
            }
        }
        for (int i = 0; i < a.length; i++) {
            if (c[i] == maxc) {
                cl = i;
                break;
            }
        }
        if (maxa>=maxb&&maxa>=maxc){
            System.out.print(maxa+" "+1+" "+(al+1));
        }else if (maxb>maxc&&maxb>=maxc){
            System.out.print(maxb+" "+2+" "+(bl+1));
        }else {
            System.out.print(maxc+" "+3+" "+(cl+1));
        }

    }

}
